package com.decent.ejfadmin.migration.service.impl;

import com.decent.ejfadmin.migration.dao.MigrationDao;
import com.decent.ejfadmin.migration.entities.MigrationReportVO;
import com.decent.ejfadmin.migration.service.MigrationService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 豆乐卡迁移外放功能管理
 *
 * @author wangyx
 */
@Slf4j
@Service
public class MigrationServiceImpl implements MigrationService {
    @Resource
    private MigrationDao migrationDao;

    /**
     * 收卡统计
     *
     * @param pageInfo  分页组件
     * @param startTime 查询开始时间
     * @param endTime   查询结束时间
     * @return pageInfo
     */
    @Override
    public PageInfo<MigrationReportVO> report(PageInfo<MigrationReportVO> pageInfo, String startTime, String endTime) {
        PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
        return new PageInfo<>(migrationDao.report(startTime, endTime));
    }
}
